//
//  RegitsterPhoneRequest.m
//  DYLYJ
//
//  Created by JM on 15/11/20.
//  Copyright © 2015年 JM. All rights reserved.
//

#import "RegitsterPhoneRequest.h"

@implementation RegitsterPhoneRequest
- (void)didRealRequest {
    [[XPGWifiSDK sharedInstance] registerUserByPhoneAndCode:self.DY_phone password:self.DY_password code:self.DY_code];
}

//使用注册事件：[XPGWifiSDKDelegate XPGWifiSDK:didRegisterUser:errorMessage:uid:token:]

- (void)XPGWifiSDK:(XPGWifiSDK *)wifiSDK didRegisterUser:(NSNumber *)error errorMessage:(NSString *)errorMessage uid:(NSString *)uid token:(NSString *)token{
    if(error.integerValue == XPGWifiError_NONE) {
        RegitsterPhoneResponse* response = [RegitsterPhoneResponse response];
        response.DY_wifiSDK = wifiSDK;
        response.DY_uid = uid;
        response.DY_token = token;
        self.block(response,nil);
        
        
    }
    else
    {
        self.block(nil,[NSError dy_errorWithErrCode:error.integerValue errMessage:errorMessage]);
    }
    [super superHandelResponse];
    
}

@end

@implementation RegitsterPhoneResponse


@end
